{% extends 'admin-v2/layout.html.twig' %}

{% do script(['app/js/admin-v2/operating/certificate/manage/index.js']) %}

{% set menu = 'admin_v2_certificate_manage' %}

{% block main %}
  <form class="well well-sm form-inline" method="get">
    <div class="form-group">
      <label>{{ 'admin.operation_certificate.template.type'|trans }}:</label>
      <select class="form-control" name="targetType">
        {{ select_options(dict('certificateTypes'), app.request.query.get('targetType'), 'admin.operation_certificate.template.type.all'|trans) }}
      </select>
    </div>
    <div class="form-group mll">
      <label>{{ 'admin.operation_certificate.template.title'|trans }}:</label>
      <input class="form-control" name="nameLike" type="text" placeholder="{{'admin.custom_page_manage.keyword_placeholder'|trans}}" value="{{ app.request.query.get('nameLike') }}">
    </div>
    <button class="btn btn-primary" type="submit">{{'form.btn.search'|trans}}</button>
  </form>

  <table class="table table-hover table-striped" id="certificate-table">
    <thead>
    <tr>
      <th width="10%">{{'admin.operation_certificate.certificate.num_th'|trans}}</th>
      <th width="25%">{{'admin.operation_certificate.certificate.name_th'|trans}}</th>
      <th>{{'admin.operation_certificate.template.type'|trans}}</th>
      <th>{{'admin.operation_certificate.template.create_time'|trans}}
      <th>{{'admin.operation_certificate.certificate.status_th'|trans}}</th>
      <th>{{'admin.operation_certificate.template.operate'|trans}}</th>
    </tr>
    </thead>
    <tbody>
    {% if certificates %}
      {% for certificate in certificates %}
        {% include 'admin-v2/operating/certificate/certificate-tr.html.twig' %}
      {% endfor %}
    {% else %}
      <tr><td colspan="20"><div class="empty">{{'site.datagrid.empty'|trans}}</div></td></tr>
    {% endif %}
    </tbody>
  </table>
  {{ web_macro.paginator(paginator) }}
{% endblock %}